﻿@model ADIGRE.Domain.Pessoa
@{
    ViewBag.Title = "Cadastro de Pessoas";
    Layout = "~/Views/Shared/_LayoutLogado.cshtml";
}
@using (Html.BeginForm())
{
    <center>@Html.ValidationSummary(true, "Atenção!")</center>

    @Html.Partial("_Pessoa", Model)

    if ((bool)ViewBag.IsRoot && Model.Usuario != null)
    {
    <div id="usuario">
        @Html.Partial("_Usuario", Model)
    </div>
    }
    <p>
        <input type="submit" value="Cadastrar" class="btn-gold"/>
        <span>&nbsp;</span>
        <a onclick="javascritp:window.history.back(1);" class="btn-gold">Voltar</a>
    </p>
}
@section Style {}
@section Script {
    <script type="text/javascript">

        ExibirUsuario();
        $("#IsUsuario").click(function () {
            ExibirUsuario();
        });
        function ExibirUsuario() {
            if ($("#IsUsuario:checked").length > 0)
                $("#usuario").css('display', '');
            else
                $("#usuario").css('display', 'none');
        }

    </script>
}
